class YYObject4 {
    constructor() {
        this.a = 1;
        this.b = 2;
    }
    geta() {
        return this.a;
    }
    getb() {
        return this.b;
    }
}

class YYObject5 {
    //ES6没有默认属性
    //state = 0;
}


(function (exports) {
    'use strict';

    class YYObject3 {
        constructor() {
            this.a = 1;
            this.b = 2;
        }
        geta() {
            return this.a;
        }
        getb() {
            return this.b;
        }
    }

    function YYObject() {
        return {
            a: 1,
            b: 2,
            geta: function () {
                return this.a;
            },
            getb: function () {
                return this.b;
            }
        }
    }

    function YYObject2() { }
    const proto = YYObject2.prototype;
    proto.a = 1;
    proto.b = 2;
    proto.geta = function () {
        return this.a;
    }
    proto.getb = function () {
        return this.b;
    }

    exports.YYObject = YYObject;
    exports.YYObject2 = YYObject2;
    exports.YYObject3 = YYObject3;

}(this || {}));